package org.forever.learn.util;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import jdk.jfr.Description;

import java.util.function.Function;

@Description("查询指定客户邮箱的收支情况")
//dayCountFunction
public class DayCountFunction implements Function<DayCountFunction.Request, DayCountFunction.Response> {
    @Override
    public Response apply(Request request) {
        return new Response(String.format("%s邮箱收入300元，支出180元", request.dateStr));
    }


    public record Request( @JsonProperty (required = true)
                               @JsonPropertyDescription("需要查询收支的邮箱")
                               String dateStr){

    }

    public record Response(String dailyCount){

    }
}
